package com.example.xadmin.pojo;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDate;
import java.util.Date;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 
 * </p>
 *
 * @author Administrator
 * @since 2020-04-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_user")
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = ID, type = IdType.AUTO)
    private Integer id;

    @TableField(USERNAME)
    private String username;

    @TableField(PASSWORD)
    private String password;

    @TableField(NICKNAME)
    private String nickname;

    @TableField(HEADIMGURL)
    private String headImgUrl;

    @TableField(PHONE)
    private String phone;

    @TableField(TELEPHONE)
    private String telephone;

    @TableField(EMAIL)
    private String email;

    @TableField(BIRTHDAY)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birthday;

    @TableField(SEX)
    private Integer sex;

    @TableField(STATUS)
    private Boolean status;

    @TableField(value = CREATETIME,fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(value = UPDATETIME,fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;


    public static final String ID = "`id`";

    public static final String USERNAME = "`username`";

    public static final String PASSWORD = "`password`";

    public static final String NICKNAME = "`nickname`";

    public static final String HEADIMGURL = "`headImgUrl`";

    public static final String PHONE = "`phone`";

    public static final String TELEPHONE = "`telephone`";

    public static final String EMAIL = "`email`";

    public static final String BIRTHDAY = "`birthday`";

    public static final String SEX = "`sex`";

    public static final String STATUS = "`status`";

    public static final String CREATETIME = "`createTime`";

    public static final String UPDATETIME = "`updateTime`";


    public static final String ID_COMMENT = "";

    public static final String USERNAME_COMMENT = "";

    public static final String PASSWORD_COMMENT = "";

    public static final String NICKNAME_COMMENT = "";

    public static final String HEADIMGURL_COMMENT = "";

    public static final String PHONE_COMMENT = "";

    public static final String TELEPHONE_COMMENT = "";

    public static final String EMAIL_COMMENT = "";

    public static final String BIRTHDAY_COMMENT = "";

    public static final String SEX_COMMENT = "";

    public static final String STATUS_COMMENT = "";

    public static final String CREATETIME_COMMENT = "";

    public static final String UPDATETIME_COMMENT = "";



    public static SysUser of(Object obj) {
        SysUser e = new SysUser();
        BeanUtils.copyProperties(obj, e);
        return e;
    }

    public static QueryWrapper<SysUser> queryWrapper(Object obj) {
        return new QueryWrapper<>(of(obj));
    }

}
